compile a static lib