Since the pkg-config file name of Lua 5.1 is different from places to places (lua, lua51, lua5.1, etc.), the build system should check for each of these before giving up. Autotools works fine, but Waf misses this.
Attached a patch that fixes this, hopefully in a not-that-ugly way. Tested under Debian Unstable/Sid.