fix libwrap and libdbi detection logic