Build system abstractions

In particular, this makes cross-compilation from Cygwin to Windows (mostly) work