fix lua 5.2 version check in luabackend
make luabackend respect LUA_LIBS instead of forcing -llua5.1
Use LUA_CFLAGS and LUA_LIBS instead of hardcoded paths.