Yes, Iraq is not yet a stable democracy, but many people doubt whether Iraq can ever become a stable democracy*, no matter what level of intervention we attempt. Nation-building was not the primary objective, so would we be "accepting defeat" if we leave before it is accomplished? Hardly.
*Traditionally, it has been conservatives who have questioned whether our country should be engaged in nation-building, and many question whether it is even possible in non-Western countries like Iraq. Foreign policy liberals, beginning with Woodrow Wilson, have advocated such policies, but I think it is far from clear that this approach is best.
The British were not about to achieve it even after ten years in Iraq.
Before I can fully respond, I need to know what you mean by nation-building. There seems to be many definitions of it. What is yours?