The verb "unite" is correctly followed by the preposition "in" when describing participation in a collective effort. The phrase "unite in the attempt to solve" is idiomatic. "Unite towards" is not standard English. "Unite on" suggests agreement on a specific point, and "unite for" would indicate purpose but doesn't collocate well here.