Fix linkage order for Ubuntu.