When writing characters, always make sure all of your characters are heroes in their own minds. Nothing drives me nuts more than watching a movie and not understanding the motivation of a character. Sometimes you see it in leading characters, where they go about life like a leaf in the wind. It makes me not care for that character, or the story, and I'm more likely to put the book down.
Think of your favorite movies, and consider the main motivation in the lead characters. Frodo wanted to destroy the ring. Harry Potter wanted to conquer evil and protect his friends and loved ones. The Dread Pirate Westley wanted to wed Buttercup. Ender wanted to win games. And Luke wanted to go to Tosche Station and pick up some power converters. No, I mean he wanted to go and kiss his sister. No, no... wait. What did he want? Oh, yeah, he wanted to kill his Dad. Or save him. Or... okay, no wonder he was such a whiny teenager.
Secondary/supporting characters need to have the same thing. I know that a lot of decent movies who have secondary characters who just seem along for the ride. But great movies have secondary characters who are trying to accomplish something. This can also be a great source of conflict, because a "good guy" could have different goals from the "main good guy."
Samwise Gamgee wanted Frodo to succeed, even when Frodo didn't. Ron Weesly wanted notoriety and money, even though his best friend seemed to have everything he ever wanted. Inigo Montoya wanted revenge, even if it meant leaving Westley behind to pursue it. Jar Jar Binks wanted... oh, who cares. How did he live through the trilogy, that's all I want to know?
All of these main and supporting people have something in common. In their own mind, they are the hero. Some of them may not like playing second fiddle to the main character, which can introduce some tension (again, see Ron Weesly), but it is what gives depth to characters. It is what makes it so you care for more than just one character. It is also a way to move the plot forward.
But don't forget the bad guy.
When bad guys are bad for no reason, I tend to lose interest. When their only motivation seems to be the thwart of the good guy, I usually get bored and look the other way. Give the bad guy a good motivation. I'm more likely to enjoy a story where a villain wants to do something bad and the hero is trying to stop them over a story where the hero is trying to do something, but the villain just gets in his way.
Oh, where to begin on examples.
Okay, let's go with Voldemort. Yes, he's ruthless and mean, but this is a guy who thought he was wronged in life. Where everything bad that happened to him came at the hands of muggles, even his own father. So what better way to protect his world than to kill all the muggles and anybody with muggle blood in them. Keep in mind, I'm not justifying anything he did, but from his perspective, he is trying to make the world a better place. Rid the world of bad blood and things will totally go his way.
Sadly, this also sounds a lot like Hitler's motivation. I'm sure in his twisted mind, he thought he was doing the world a favor.
How about Darth Vader, one of the most loved bad guys in the history of bad guys. He fell to the dark side due to fear and a sense of loyalty to the empire (though, I'll admit, I didn't buy it). From his perspective, in the original trilogy, he was just a soldier trying to bring peace to the universe by silencing a bothersome band of rebels. Granted, I've never understood why he blew up a PLANET to prove a point, but you can tell this is a guy who doesn't mess around.
Humperdink just wanted to rule a kingdom and justify his Kingship with a war. Hmmm... I would have liked to have seen that fleshed out a little bit more. Great movie, but really, the bad guy just comes across as a spoiled brat jerk face.
Sauron just wanted to rule. I know, pretty boring. Luckily, he had some interesting minions that brought the story to life. The most interesting bad guy, to me, was Gollum--though not a direct minion of Sauron. Gollum just wanted to protect the ring, his precious, while being left alone to eat raw fish and maybe tell a riddle or two with the guests he had over for supper. He also had a split personality, with Smeagol actually wanting to help Sam and Frodo. Well, Frodo anyway. In his mind, he justified what he did and remained the hero in his own mind. SPOILER ALERT: In a way, he ended up being the hero of the entire series, being responsible for the downfall of Sauron and the success of man, elf, and dwarf.
Finally, there is the latest incarnation of the Joker. He is probably my most favorite bad guy of all. He has one of the most unique motivations ever... and it wasn't the usual cliche of either money, power, or fame. In a nutshell, he just wanted to see the world burn.
Well, I think there was more than that. He looked at society and saw all the hypocrisy that society had, and he wanted to expose it. Cops were crooked. Thieves were weak and short-minded. Society was fragile and just an accident or two away from complete anarchy. Gotham's White Night, Harvey, had a bit of a vigilante streak in him. Even the test he did with the boats, trying to get the "good guys" of society to murder a boatload of people just because they were more deserving (but to be honest, I'm glad I wasn't on that boat having to make that decision). One of his biggest motivations was to get Batman to break his one rule, which would cause him to lose all credibility with Gotham, and the Joker was willing to sacrifice his own life to accomplish it. It didn't work with Batman, but it did work with another one of the good guys, thus making The Joker successful.
So, if you are looking to push your book to the next level, look at all of your characters. I'd say anybody with dialogue, even if it's one line. If you can't tell what his or her motivation is from that one line, work it in somehow. Make sure your heroes and supporting cast have solid motivations. And if you can make the bad guy think he is a hero, then you've got a good recipe for success!
One last note: watch the show "Once Upon a Time." There are good guys and bad guys galore. And EACH of the bad guys has a justifiable reason to think they are doing the right thing. It is wonderful. Sometimes, I wonder who I should be cheering for. Not one person is bad just for the sake of being bad, they are all heroes in their own minds.