Fix some compiler warnings and give full path to ldconfig
allow linking against non-shared mongoclient libs
make everything work with older versions of mongo driver