I don't know if it was clear, but for a more portable module (that does not 'only' work on the 99% of the systems with a gnu make) you write a configure script that checks for the cflags, compiler etc, and Makefile.in that is sort of similar, only somewhat shorter, using the detected values.