BUG/BLD: add compiler flag for older compilers

The -D_GNU_SOURCE is needed by older versions of GCC. Many newer versions 
enable this flag by default, which is why it wasn't being caught before.

closes #3957.