Fix CFLAGS manipulation

The code for ensuring that CFLAGS contain -g if
--enable-debug has been specified did not work right.

https://bugzilla.gnome.org/show_bug.cgi?id=685204