Dont use HeadKaze compiler - this has the latest version of mingw, which is incompatible with the version you are trying to compile.
1] delete everything you have (source, tools, compilers - the lot)
2] create a mamesrc folder in c:\ (so its c:\mamesrc)
3] unpack the mame source code to this folder
4] get this version of the compiler tools
http://www.mameworld.info/misc/mingw-mame-20100102.exe5] unpack that to c:\mingw
6] get the correct version of the hiscore patch and place it in c:\mamesrc
7] Open a command prompt and navigate to c:\mamesrc
8] type these commands into the prompt:
SET Path=c:\mingw\mingw64-w64\bin
patch -p0 -E <xxxxx.xxx (xxxxx.xxx = whatever your hiscore patch was called)
make
This will patch and compile 0.137 for a 64 bit system, for a 32 bit compile change the path in 8] to the mingw32 path.
This is all from memory, but im pretty sure it should work.