Remove unused libraries from linking