refine handling of so links inmakefile