It isn't as though your body only gives you two options:
1) lose fat and become weak and skinny, or
2) go into hibernation mode and only gain muscle while becoming obese
But unfortunately a lot of people seem to have gathered this impression from the internet.
My advice is to simply improve your lifestyle on the whole. Start by eating a healthy diet (does not need to be drastic), doing cardio several days a week, and lifting weights intensely a minimum of 4 days a week.
DIET -
~Eat 1.5 grams of protein per pound of bodyweight daily to build muscle.
~Try to avoid sugar and trans fats.
~Although you probably don't have to count calories, don't be that guy that goes "health crazy" and ends up eating 100 calories of blueberries and yogurt each meal.
*Simple daily diet guideline that a lot of people seem to like:
-One pound of meat (any kind you like, does not have to be all in one sitting), half a dozen eggs (any way you like, doesn't have to be all in one sitting), and 2 protein shakes every day. Fill in the rest of your hunger with whatever you want (ideally complex carbs).
Organize 4-7 meals any way you want, do the same thing every day, or change it all the time, as long as you meet that quota every day. Just a suggestion, but like I said I let everyone in on that who PM's me asking for advice and I've heard nothing but success (I follow the same guideline myself).
CARDIO -
~3-5 days a week of whatever you want.
LIFTING -
~I realize internet nerds have made Starting Strength sound like a miracle beginner program, but it's really just a train that only stops in failure city. Unless you want lagging bodyparts and a bench/overhead press that never seems to go up, just train with a traditional program (refer to the Bodybuilding Bible link in the bodybuilding sticky: The Best of T-Nation).
~Most important parts of training: safe form, progressive overload, getting a pump, and busting your ass.
Good luck!