Implement flexible target specification

See commit message.
Windows was actually the one target where we *didn't* pass `-nodefaultlibs`, all other targets should have it.