build: allow to override the lua pkg-config

minor cleanup in the makefile while there
use memcmp for ends/startswith

This should be faster and fixes an unintialized value of 'i' error.
build: set -fPIC even if we override CFLAGS
add gitignore
add support for Lua 5.2
add ldoc documentation
Merge pull request #1 from ncopa/master

add support for Lua 5.2