Fix linking in gcc

Closes gh-1