Make example and test build and link correctly