Why are you trying to build it when it is available through the Ubuntu repos…?

sudo apt-get install gimp-plugin-registry

This has, amongst several other nifty plugins, the ‘save for web’ plugin.

Just install, restart Gimp and find it in the drop-downs from the ‘File’ menu.