If you never intend to use the bike with the drops again, sell it, and buy a bike designed for flat bars.
Road bike generally will convert badly to hybrids (which is what you're effectively asking about), the same way that hybrids don't really work with drop bars.
The geometry will be compromised whichever way, making a purpose-built bike the better option either way.
If you really want to go ahead, you will need to source road compatible flat bar shifter (the M4000 may or may not work, pre-10 speed everything was compatible between road and MTB, now, don't count on it for any speed above 8 with current components), compatible brake levers, and work out the best stem/handlebars solution that make the bike comfortable. Given the age of the bike (as it has 9-speed Ultegra), it's at least 15 years old, you will probably have issues with tire clearance over 25mm as 23mm was the norm back then and anything wider was uncommon for a road bike.