swapping order of target link libraries to fix compiling error