Added fixes for Windows. Try building with: http://getgnuwin32.sourceforge.net/