Support for mingw build

This pull adds support for mingw building. 
In short, it just defines windows if it's not already defined