Better library detection for configure checks.