fix duplicate LIBRARIES

credit: westcripp