Add QT_DEBUG flag to darwin

Also small fix to X11 and Linux.
Merge pull request #7 from guitorri/fix-build

Add QT_DEBUG flag to darwin