cargo cult some defines from old configure
add -mconsole to mingw link flags after all other flags..

fuck.. this was hard.