Ok. I'll investigate Makefile itself first, maybe it's possible to rewrite it without using GNU extensions.