Fix handling of libdl.