Does the lua install include lua-config / pkg-config files on Linux? If so, you could call one of them: http://manpages.ubuntu.com/manpages/lucid/man1/lua-config50.1.html
That's the best way since it doesnt involve hard coding or overrides except for weird cases.
I added the Makefile to /trunk/externalsloaders/pdlua/ in svn. The problem I get is that it looks for lua.h in /usr/include/lua but my debian system put lua.h in /usr/include/lua5.1. I know if you get lua independently of debian it will go into /usr/include/lua. What is the best way to resolve this path for the different versions and different packages? Is a configure script needed to set LUA_CFLAGS and LUA_LIBS?