build: move to autotools based

Getting the proper Lua path and flags for different distro is a quite
tough problem. Rely on autotools macros instead of an hard-coded
solution, already tested on other projects.