Fixes linking for tests and examples.