compat: include config.h in compat.h

Without this inclusion, no `HAVE_*` macro was defined. This was
triggered because with some libc, `strndup()` is defined by a macro
and therefore cannot be redefined as a function.