Make the title be part of the first name in this instance!
That would allow you to greet them with "Dear Mr. Joe" or "Dear Mr. Joe Smith", but not with the far more appropriate "Dear Mr. Smith".
And prepending the title to the surname would yield "Dear Joe Mr. Smith", which is even worse.
For now the best way is the "Dear" + name1 + name2, suggested in the first post, but the proper way would be adding a "title" field to the contact. That's a change that should not break anything.
I don't know how the templates are handled, but ideally they should be translated/adapted according to local customs. And while we're at it, the contacts should probably have a language field as well, so that documents can be issued in that particular language. That would be a nice touch in bilingual countries. Or for anyone doing business in more than one language, for that matter.