You should see if Chibi has the same problem, since it uses a very similar Makefile.detect.
Chibi seems to avoid the problem by checking for the OSes without `uname -o` support before the OSes that require it. All the checks are chained together using "else if" so the first passing check causes the remaining ones to be skipped.
https://github.com/ashinn/chibi-scheme/blob/f48312fad3bca50db2f66c7050a2c3bd27dafd82/Makefile.detect