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`.
Merge pull request #3524

67d60f7 build: fix MacOSX build after ec41342 (Wladimir J. van der Laan)