Fix getlibdirs when libdirs is unset