improve the mergedlib script