fix link bug for static builds