Refactor lua check into new cmake function

- CMake function check_lua_deps to check if lua has all dependencies
- cmake -DLUA_PRG= is now working again and is passed against
  check_lua_deps