Fix link errors on Mac