Fix luaJIT compile errors and dependencies