Refine project settings to build lib