fix copying contents in /usr/local/lib and cleanup