Properly generate rlibs and dylibs