Fixed linking and library creation.