Fix linux build

The cocos library uses libpthread and libGL on linux, so we need to link
with them.
Merge pull request #2212 from rogerzanoni/linux_link

fixed #2044: Fix linux build, libpthread and libGL libraries need to be linked on linux.