Even when static option isn't enabled, use the static library path if the dynamic library isn't found.