Thanks for the reply.
The Lua 5.1.5 source code does not generate a shared object, but only a static library. There are no options in the Lua Makefile to generate a dynamic lib.
Usually it should not be necessary to add the lib to the X_LIBS var, since configure is supposed to do that. These env vars should only show the locations of the include and library files (and necessary 3rd party libs - not the lib itself!!!).
Anyway, adding the lib to LUA_LIBS made it worse. The module did not even compile anymore.
cc -shared .libs/alloc.o .libs/data_conversion.o .libs/library.o .libs/luasandbox.o .libs/timer.o .libs/luasandbox_lstrlib.o -L/usr/local/lua-5.1.5/lib -lrt -llua -Wl,-rpath -Wl,/usr/local/lua-5.1.5/lib -Wl,-soname -Wl,luasandbox.so -o .libs/luasandbox.so
/bin/ld: /usr/local/lua-5.1.5/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
/usr/local/lua-5.1.5/lib/liblua.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [luasandbox.la] Error 1