fixed issue in add library macro with external libraries