build: remove config.h.

The config.h file is too easy to misuse, and since the checks are now
very limited, there is no reason not to just use CFLAGS to pass the
few definitions that are actually used.
build: use non-deprecated libtool macro.
build: check for system extensions during ./configure.

This avoids defining _GNU_SOURCE unconditionally, and instead use
whichever system extensions apply to the current host.