System platform check is broken for Cygwin

$(OS) makefile variable in cygwin is the same as in regular windows shell. Using python to detect platform allows Cygwin to be treated like all other POSIX systems.