configure: fix definition of HAVE_LMDB
another try on fixing dynamic linking