build: Fix linking on some platforms

Should fix bug #7.