cannot run C compiled programs

Every now and then I come across this message, but apparently far too seldom, otherwise I would've remembered:

$ uname -sr
NetBSD 4.0.1
$ ./build.sh tools
[...]
No nonexistent/bin/nbmake, needs building.
Bootstrapping nbmake
checking for sh... /bin/sh
checking for gcc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... configure: error:
 cannot run C compiled programs.
If you meant to cross compile, use `--host'.
That's a weird way for saying that /tmp is mounted noexec :-\