Make external library search more robust on unix systems.