This commit fixes two items:
1. Previously `configure` would search for Lua in known paths, but
this could cause the Makefile to use inconsistent header and library
paths. For example, if luajit were installed in `/usr/local/include`
but lua 5.1 were installed in `/usr/lib/liblua-5.1.so`, the build
would attempt to use the luajit headers but link against the lua 5.1
library.
To fix this, we switch the order of the search:
* First attempt to find an installed LUA library with `pkg-config`.
* If we cannot find a library that way, fall back to the known-path
scan.
This is actually what is already documented in `LUA_POSSIBLE_PATHS`.
2. Add luajit back into `LUA_POSSIBLE_LIB_NAMES`. This was added in
0ac23a47 but quietly reverted in fe98ce4c. The changes in the first
item also ensure the `CFLAGS` are set properly for luajit.
This should fix the issues raised in #1909.
In particular, on CentOS 7.3.1611 building libmodsecurity with
default configure options ends up with failure while compiling
src/engine/lua.cc, while config.log states that Lua was disabled.