I'd say to get a flat stomach there is probably no other way than to build muscle and reduce your body fat.
I know exactly how you feel. The way to do it: consume less calories than you produce. It's that simple. Eventually the extra stuff on your tummy will disappear. Either you do it with working out more and eating the same amount as before, or eat less. But as you want to build muscle, do hint nr. 1. Try and swap as much white carbs for multi grain as possible, and the ideal would be to eat as much lean meat e.g. chicken and pork as possible. And lots of vegetables. That will give you a pretty low calorie intake. I lost 20 pounds in 3 months and it stayed off, my net calories were about -1000 per day on average. Good luck! P.s. this is a pretty heavy diet I've suggested, so don't stick to it for more than a couple of months. It can get messy if you lose weight too quickly.
Just to be sure are you trying to build muscle by lifting and eating at a surplus? In that case you cannot tell your body where to build muscle and not to have fat.
Are you wanted to reduce your body fat % and to preserve muscle (and, maybe, hope for newbie gains) and try to have your muscle tone show a defined stomach as a result as well? If you lift weights and eat at a deficit you will achieve this.
Are you already low in weight, upset you still have fat over your stomach but cannot really afford to lose more weight, so you are hoping to gain muscle weight while trying to lose the fat on your stomach? This is more complicated best results is eating at a deficit (pref small, some say no more than -300 deficit) or you can lift on maintenance and try for inch loss and newbie gains. This is something you may need to look up on I am not the most positive but that is basically what I have read on reducing body fat %.
But all of these will take time, effort and discipline, people work on it for months and years.