I'm also having trouble compiling.
I get the following with the current build tools:

Code
make -j9 USE_NETWORK=1 sse4=1 PTR64=1 NOWERROR=1

Code
../../../../../src/emu/luaengine.cpp: In member function 'void lua_engine::start_console()':
../../../../../src/emu/luaengine.cpp:1026:2: error: 'thread' is not a member of 'std'
  std::thread th(::serve_lua, this);
  ^
../../../../../src/emu/luaengine.cpp:1027:2: error: 'th' was not declared in this scope
  th.detach();
  ^
../../../../../src/emu/luaengine.cpp: At global scope:
../../../../../src/emu/luaengine.cpp:864:14: warning: 'void* serve_lua(void*)' defined but not used [-Wunused-function]
 static void *serve_lua(void *param)
              ^
make[2]: *** [../../../../mingw-gcc/obj/x64/Release/src/emu/luaengine.o] Error 1
make[1]: *** [emu] Error 2

Near the beginning I notice this:

Code
emu.make:1286: recipe for target '../../../../mingw-gcc/obj/x64/Release/src/emu/luaengine.o' failed