Using the term "embracing" is a little unfair Geronl. Giving a few facile compliments is not what I would exactly call "embracing".
Politicians / business people being complementary to people they don't necessarily like is a time-honored tradition. It has strategic value, because it makes it more difficult for the subject being glad-handed to attack the person giving the compliments.
In Erdogan's case, the Trump administration already thumped Edrogan pretty hard by steadfastly refusing to turn over a dissident living in the USA to Turkish authorities trying to extradite him back to Turkey on accusations that he directly conspired and participated in the recent failed coup there.
Also, Erdogan is a duplicitous leader who is hated by as many (or more) Turks than support him, so Trump's fairly tame niceties will very likely be perceived as exactly what they are - part of a strategery (sic) which includes both the carrot (nice) and the stick (naughty). Muslim nations understand that the president is sort of a sovereign and that one does not as a rule insult the sovereign without running the risk of being seen as insulting the nation itself.
The language of diplomacy is often not really the same one as the language of every day conversation. If the US acts against Erdogan at some point in the future, DJT's niceness will make his change in attitude seem even more dramatic at that time.
The dynamics are part of the strategery (sic).