app_lua: search for for lua 5.1 compilation flags

- lua 5.2 embedded api is not compatible with 5.1
- an upgrade to c code in app_lua is required, till then, lua-5.1 has to
  be installed (can co-exist with lua 5.2)