You want to fix the pirate problem off the East coast of Africa? It's simple: you do exactly the same thing the Germans did during World War II - you set up a wolf in sheep's clothing. More specifically, the Germans used false flag commerce raiders to destroy enemy merchant shipping. But the Germans had a bigger problem than we do. By the rules of war, they needed to drop the false flag and raise a proper one before they could engage in combat. And combat for them meant destroying and sinking naval vessels while attempting to either destroy or evade heavily armed enemy men-of-war.
The problem that must be solved today off Somalia is much simpler: the pirates are not nearly so well equipped and armed, and if you can apply a couple squads of Marines to the situation, it's pretty easily resolved in our favor. And such a ship flying the American flag, strictly speaking, wouldn't be flying a false flag.
The U.S. government needs to pull a couple liberty ships out of the mothball fleet, put a company of Marines in the hold, and run them along the shipping lanes with a big American flag. For extra points, paint them with the livery of the Maersk lines. When the pirates come, let 'em get real close, and then let the Marines do what they do best. Do that a few times and despite their bravado, I suspect the pirates will think a little harder before going after an American flagged merchant ship.