build: use same CFLAGS in autotools build as in gyp

Closes #1362