build: fix MacOSX build after ec41342

Fix regression introduced in ec41342.

Also use a less ugly solution, by defining the value of `MOC_DEFS` in the configure script instead of `Makefile.include`.