fix and cleanup setup script

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)