fix error in building shared libraries