Well I've discovered the build folder was the previous obj folder, so now I just delete it before I run make both mess and mame and seems to compile just fine. Thanks for the explanation.