If Martha Coakley loses tomorrow it will certainly have a lot to do with her running a poor campaign, but ultimately it will be a repudiation of the President.
Scott Brown is winning 20% of the vote from people who voted for Barack Obama last year, but these are not people who think he's doing a great job and just think Coakley is a duddy candidate. For the most part it's people who voted for Obama and aren't happy with how he's performed in office. Among the Obama/Brown voters just 22% approve of the President's work and only 13% support his health care plan.
Coakley is leading Brown 87-10 among voters who still approve of Obama, so it's not as if she's losing a ton of support from people who are still happy with him. Brown has a 96-3 lead with ones who disapprove of Obama.
Coakley has run a bad campaign, no doubt. But the state of the race in Massachusetts is more a function of unhappiness with Barack Obama and Congressional Democrats than anything having to do with her.