Improved CFLAGS/CPPFLAGS handling

- Language extensions, such as _GNU_SOURCE are now enabled through
  CPPFLAGS by the configure script, rather than within the source code.
- Moved some configure-time CFLAGS to CPPFLAGS, where appropriate.
- Fixes bugreport:8211, thanks to Neoth
  http://hercules.ws/board/tracker/issue-8211-compiling-warning-in-linux

Signed-off-by: Haru <haru@dotalux.com>