This was Germany's final World Cup warm-up game before South Africa and the Germans responded to Edin Dzeko's early goal with an impressive performance, but the captain said there is still room for improvement.
"I am unhappy we didn't keep a clean sheet," said Lahm.
"We struggled to create goals in the first-half, but luckily we worked things out.
"I look forward to the World Cup, we are in a good mood, have trained well and are fit."
With Ballack out of the World Cup, Lahm will wear the captain's armband in South Africa when Germany open their campaign against Australia in Group D on June 13.
Bosnia - who just missed out on the finals after losing to Portugal in a play-off - were dangerous in the first-half, but ill discipline cost them dearly in the second-half.
"We played well in the first half, but after the break we didn't cope very well with a young German team," said Bosnia coach Safet Susic.
For Germany, both Podolski and Oezil looked threatening and crashed their shots against the Bosnian crossbar at various times.
But veteran Klose was again unimpressive up front and is in danger of losing his place in the starting line-up.
With Germany flying to South Africa on Sunday, Lahm led the side in Frankfurt, but it was not the type of start he would have wanted.
He was at fault when Bosnia took the lead after he tried to clear the ball from a Dzeko attack, but could only watch in horror as the ball hit the Wolfsburg striker on the chest and looped over Manuel Neuer in the German goal.
Having fallen behind to the 15th-minute goal, Germany laid siege to the visitors goal with Oezil going close with a couple of clear chances while Podolski rattled the cross-bar with a fierce shot.
But the hosts finally had their patience rewarded when Lahm went on a weaving run at the Bosnian goal and buried his shot past goalkeeper Kenan Hasagic on 51 minutes.
Both Cacau and Oezil went close with efforts in the final 30 minutes as Germany piled the pressure on the guests' goal.
With 20 minutes left, Werder Bremen Marko Marin came off the bench against the country of his birthplace and was straight into the attack, winning a penalty just two minutes after his introduction.
He was brought down by Sanel Jahic and Schweinsteiger netted the penalty on 72 minutes.
He was lucky to escape a red card as he clattered Marin in the last six minutes and then struck the diminutive winger on the side of the head, but the referee branded only the yellow card.
Source: AFP Global Edition