Merge pull request #1032 from heuripedes/master

Use -lcg on Win32-targeted builds
(qb) Always set CG_LIBS
Fix typedef redefinition