I found a bug in the game, if you walk all the way to the right and jump into the wall while holding right (D) you stick to the wall. If you then repeatedly press jump then you start moving up.
I was able to get all the way to the top of the building.
Then I could just jump down to the flagpole and finish the game.