One wall of the LBJ Library in Austin celebrates “the thousand laws” of Lyndon Johnson’s Great Society, and a showcase proudly displays legions of pens, row upon row, which he used to sign the various measures. Many of the laws were nation-changing in their sweep and impact — for example, the Voting Rights Act, federal aid to education, and Medicare. Some others, full-hearted in intent, were flawed in execution: the War on Poverty was underfunded from the start, starved by the war in Vietnam, and then discarded by Richard Nixon.

On balance, the record is a prodigious catalogue of achievement, at least in the legislative arena, meriting what LBJ always yearned for: comparison with FDR.

Today the wall in the LBJ Library stands not only as a tribute, but as a warning that legislative achievement is not enough. The lesson is increasingly relevant to Barack Obama. Indeed two dangers that undid Lyndon Johnson now threaten the success of Obama's presidency.

Obama has to tell us who he’s fighting for, who he’s taking on, and why the Republicans are the party of “greed and privilege.”

First, LBJ never sustained an emotional link with the American people. He was the sum of his acts, of a bewildering blizzard of bills, but he never connected them to a continuing narrative that conveyed an encompassing vision and inspired the nation. JFK had accomplished less, but touched Americans far more deeply. Johnson’s call to “the Great Society,” fashioned by Kennedy speechwriter Richard Goodwin, was brilliant. But over time it was reduced to an amorphous tagline, as the central arguments Johnson set out in that speech dropped from his discourse and from the national consciousness. The one time when he was most notably inspiring was his address to Congress on voting rights, pledging the whole nation to the anthem of the civil-rights movement: “We shall overcome.” But it never lasted — and it always rankled Johnson that it was Kennedy’s photo, not his, that hung in so many African-Americans’ living rooms.

In part, Johnson couldn’t define a narrative because he wanted to erase the dividing lines and be “president of all the people.” FDR had taken on “the economic royalists.” Reagan would relentlessly pound on big government as the enemy. JFK was the foe of a powerful steel industry that broke his wage and price guidelines. LBJ, on the other hand, was a happy ally of Brown and Root, the predecessor of Halliburton and today still part of it.

In 2008, Obama defined a narrative that persuaded ordinary Americans he was on their side, establishing his opposition to “corporate lobbyists,” to “companies that are moving jobs overseas,” to “the insurance industry.” Yes, there was talk of transcending the barriers of partisan politics — but not at the price of abandoning or trimming progressive purposes. Beyond all that, because of who Barack Obama was, his victory validated our noblest conceptions of ourselves as a people.

Since then, as he’s pushed fundamental change through Congress, his emotional connection with the country has frayed. Some observers blame his overexposure, his omnipresence on television day after day. That’s all but unavoidable in a 24-hour news cycle — one in which rumors like “death panels” are propagated in the name of balanced coverage. Obama has to answer charges like this and make his point more than once or twice or even 10 times; if he did, his words would sometimes be consigned to the back pages or the back half of the news, behind Natalee Holloway or the tea baggers’ latest outburst of paranoia. In a world of atomized information outlets, the competition for audience drives an entropy of attention. What matters is not whether he’s “overexposed” — what choice does he have when the Bully Pulpit has become a Bully Lectern? — but what he says.

The president has to tell us who he’s fighting for, who he’s taking on, and why the Republicans are not just the party of no, but — in the words of FDR — the party of “greed and privilege.” He can’t allow himself to be trapped in futile pleas for bipartisanship reminiscent of LBJ’s protean desire to be loved by everyone. It’s decision time — he has to draw sharp and vivid distinctions that can seize and hold the nation’s attention. To pose a compelling choice, he has to show that his domestic fights, from jobs to health care to taxes, all exist within the same framework.

Thus, Obama shouldn’t duck or compromise on Republican demands to re-up the Bush tax cuts for the very wealthy scheduled to expire at the end of December. Ignoring the rump of lily-livered Democrats who want to cut and run, the president should embrace this contest and hammer away at the choice: He’s for middle-class tax cuts — and the GOP is for a windfall that would comfort the comfortable, do less than almost any alternative stimulus to spur the economy, and add $1 trillion to the deficit in the coming decade. This goes to the heart of the difference between the parties, extending a coherent appeal to fairness over privilege. It’s also the best hope to limit midterm losses — and the best way to lay the predicate for a 2012 re-election that does more than reflect economic revival, but ratifies an ideological victory that can endure for a generation. That’s what made FDR and Reagan great.

The second danger is also recorded in Johnson’s library, a tragic coda that ultimately overwhelmed his time in office and denied LBJ his rank among the great presidents.

At home, Johnson might strive to be president of all the people, but he did have an enemy half a world away in Vietnam. Like Obama, he inherited his war: Eisenhower had sent advisors to Vietnam in 1955, and Kennedy had followed suit (although the historical record now suggests that he was determined to withdraw — but only after the 1964 campaign so he wouldn’t fuel GOP charges that he was “soft” on communism). Despite Johnson’s own doubts, revealed more and more as more of the record comes out, he pursued massive escalation in Vietnam despite a yawning credibility gap between Pentagon claims of progress and the reality on the ground.

LBJ was driven not just by policy, but by an obsession; as he complained to friends and associates, he wasn’t going to be the first American president to lose a war. This ultimately shattered his party and forced his abdication as president. He could not even appear at the riot-torn 1968 Democratic Convention. He had to pack his boxes of signing pens, take them home to Texas, and console himself with that wall of a thousand laws.

Obama, too, has escalated the conflict he inherited. He has also set a December deadline to review policy in Afghanistan and a squishy deadline to begin removing troops next summer. But WikiLeaks' document dump has focused attention on the reality: The war is not going well. The civilian casualties have alienated the population and attracted recruits to the Taliban; the government we prop up in Kabul is a feckless, double-dealing nest of corruption and incompetence; and the government we subsidize in Pakistan regularly plots with the insurgents to attack American forces, often with weapons we’ve sent.

The White House hates the comparison, but this sounds a lot like Vietnam. The administration denounced WikiLeaks, but the response in effect seconded the bad news. “[T]hese documents,” the president said, “don’t reveal any issues that haven’t informed our public debate.” Indeed reports from NATO and others have suggested that this surge isn’t working.

Obama won’t move before December — if he did, the GOP would attack him as “soft” on terrorism — but national security requires more than a reflex tendency to redeem a failed policy. Afghanistan, the right war after 9/11 when Al Gore as president would have dispatched massive force to smash Al Qaeda and its leaders and then leave, now looks like the wrong war when Al Qaeda has escaped and Pentagon officials say that it might take 10 or 15 years to pacify the country. The conflict is already unpopular, and there’s no chance of buying that kind of time.

The president needs to go into the December reassessment with a hard resolve: If we can’t win in Afghanistan, at reasonable cost in a reasonable time frame, the consequences of not winning aren’t relevant to whether we stay, but how we leave. We may have to settle for a deal, explicit or implicit, with warlords and the Taliban. The result may be a repellent regime; and the safeguard against the reopening of sanctuaries for terrorism will have to be the threat of massive retaliation from the air. Alternatively, if the president decides to stay the present course, he has to be honest about the definition of success and set tough benchmarks for measuring it. And this shouldn’t have to be WikiLeaked; it should all be stated plainly and publicly—and then debated openly in a round of televised Senate hearings.

The hardest thing in politics, or government, is to renounce your own strategy. But in Afghanistan, the president can’t let failure become an excuse for its own perpetuation. That’s what LBJ did in Vietnam. Instead Obama could remember JFK’s likely course; except this time, if it’s the right decision, Obama should withdraw well before the next presidential election.

Obama aspires to be a great president — and nothing here is meant to gainsay his historic accomplishments. But history is hard, always demanding more. Facing the task of re-engaging with his fellow citizens and the fateful question of disengaging from Afghanistan, this president ought to think about the wall and the pens so breathtakingly displayed in his predecessor’s library. In the end, the LBJ Library memorializes glory disfigured by disaster. It is a teaching place.

So Barack Obama must do what Johnson could not: He must reach and win the hearts and minds of the American people; and he must decide soon, with political courage, what he will do about the nation’s longest war (ironically, what Vietnam also was in its time). The truest lesson is that a president can focus on history and yet lose his place in it. Legacy matters. But like the people they serve, presidents have to live in the present, not just the future.