1.9.1 autotools modernizations

Found some minor problems getting autogen.sh to run on Arch Linux. Here are some fixes for that.

In addition, the check for lua>=5.1 has been replaced with lua==5.1 to prevent linkage against lua 5.2 due to incompatibilities, see http://www.lua.org/manual/5.2/manual.html#8