Fix linking issues with g++.
Merge pull request #7 from martin-helmich/issues/cpp-linking

Fix linking issues with g++.