The AC_PACKAGE_WANT_GDBM macro is not easily read. It's not doing
anything particularly complex other than working through a set of
alternatives for headers and libraries.
This patch cleans it up to be more readable. We also only attempt
to check in libgdbm_compat if the checks in libgdbm fail.