Fixed Linux build. Link with all libraries under MINGW only.
Trim the withespaces & \r before comparing the lines to fix Windows \r