The configuration script tries to #include the compat/headers_slim.h which is available in the package but while doing out-of-tree configuration this reports false system capabilities because the header is not in the same directory.
So we should rather use ${srcdir}/compat/headers_slim.h for #include. Attached is a patch that applies on the 2.0.5 release.