Use ldconfig to find libraries

This fixes the dependency check when the libraries are not in /usr/lib. 64 bit openSUSE, for example, uses /usr/lib64.