Make the doc makefile work on windows.

This makes the doc makefile platform independent. The main makefile has too many issues on windows, so I left it alone.

Because rm is used only once, I just put the if/endif there instead. That's because rm is hard to generalize on windows. In particular, there's no way to do pattern matching in one line e.g. build\*. for rmdir.

I did generalize mkdir. The main issue here was that windows api calls interpert a forward slash, / as similar to what a dash does on unix.