So, eight years of Iraq and eleven years Afghanistan didn't teach you anything?
Yes, that being "loved" ultimately does not work.
Remember all those folks who said that elected Obama would be so great for the rest of the world? Well, since Jimmy Carter, no US ambassador has ever been assassinated, until yesterday. That alone will not do it.
Now, that said, Obama has done a fairly good job about taking out those people that do things like this in Afghanistan and Yemen. Now, this does not mean sending in an occupation force, but it does mean being more robust in doing similar things in Libya (and perhaps being better prepared for the aftermath).
Being loved and feared is better, and possible.
Extremists don't fear the United States. They are prepared to die while attacking it.
There is not much that any president can do about that. You can try to stop attacks, and most times, the US succeeds in doing that, but stopping all of them? That is just not possible.
Iraq and Afghanistan are prime examples of that. America showed strength and the extremists did not back down.