fix setup script, port to Lua 5.2

now it builds cleanly on Ubuntu 12.10 *if* you install "lua5.1" and "liblua5.1-dev"

(before these patches, it crashed badly and unclearly, by interpreting pkg-config's error message as meaningful output: not good)

and it works with both Lua 5.1 and 5.2!