Lua is usually built as static library, and the dl-symbols (dlclose(), dlopen()) from lua/src/loadlib.c has to be resolved at link time, when using liblua. Depending how liblua was build, the code for dlclose might not be in liblua.a, so -ldl has to be specified, when linking with liblua.
The attach patch corrects configure.ac, so that always when linking with -llua, a -ldl is added afterwards (except pkg-config finds liblua, then nothing is added).
Applied for next release, thanks!
v2.9.1 released.