BUG: need to check existence of libraries and remove / re-link if they already exist