I'm trying to compile the latest MAME on Windows 10 with mingw. I get a Lua error:

Luigi@Luigi-PC MSYS /c/mame
$ make SOURCES=src/mame/drivers/atarisy1.cpp REGENIE=1
GCC 6.3.0 detected
[string "function os.executef(cmd, ...)..."]:167: 'popen' not supported
stack traceback:
        [C]: in function 'io.popen'
        [string "function os.executef(cmd, ...)..."]:167: in function 'os.outputof'
        c:/mame/scripts/genie.lua:1335: in main chunk
        [C]: in upvalue 'builtin_dofile'
        [string "premake = { }..."]:84: in function 'dofile'
        [string "_WORKING_DIR        = os.getcwd()..."]:45: in function '_premake_main'
make: *** [makefile:986: build/projects/windows/mame/gmake-mingw64-gcc/Makefile] Error 1