Fix link order of static libraries