Your build was configured with --with-system-db, so plugins/kdb/db2/libdb2 was not built, and was taken from /usr/local/include or the system include path. If that system header does not defined BTREEINFO or HASHINFO, then the failure you observed is unsurprising. Those symbols are a documented part of the BDB interface at least as of 4.2.