Fix building with cmake on cygwin.

Add required libraries for the link stage.
Merge remote-tracking branch 'github/build-bot-master' into bleeding-edge-master
2014.12.26-17.00