"which gmake" returns values that confuses the script for some
versions of which. Some versions of which will return a 0 exit code and return "no gmake in <paths>". This confuses the script. Check for this and set MAKE to "make" in this case, and hope for the best.