To assemble the pipes in the Ancient Pyramid, clear the upper part of the island from clouds: you'll find some necessary elements there. You'll need to connect the pumps (the non-movable parts) to the pipes. You can turn the pipes as you like and buy additional parts from the Market.

We've also attached a screenshot below. After you assemble the system, two pumps will not glow blue. Don't worry: this is the way it should be, those pumps are magical:)