Replace hardcoded -llmdb with variable

and rename the variable to be consistent
with what we do for other libs
Remove hardcoded -lsqlite3 with variable
Replace hardcoded -lmysqlclient -lz with variable
Replace hardcoded lib with variable
Merge pull request #1768 from rubenk/fixup-lmdb

Replace hardcoded -llmdb with variable
Merge pull request #1771 from rubenk/replace-lsqlite-with-var

Remove hardcoded -lsqlite3 with variable
Merge pull request #1772 from rubenk/fixup-mysql

Replace hardcoded -lmysqlclient -lz with variable
Merge pull request #1773 from rubenk/fixup-ldap

Replace hardcoded lib with variable