build: Use AC_USE_SYSTEM_EXTENSIONS

... instead of some grep magic.
build: Use configure.ac instead of configure.in