(qb) Always set CG_LIBS
Fix typedef redefinition
Merge pull request #1033 from heuripedes/master

Build fixes