If you get your lips in the right position, and the air hits the edge at just the right angle, you get a nice, clear note. If you want to make things easier, plug the end with a cork and drill a hole into the side of your pipe, just below the cork. You should find it's easier to play. Now drill some more holes further down the pipe. By covering them with your fingers, and then lifting one or two as you blow, you get different notes.
G etting a really nice tone and getting the notes in tune involves a lot of practice and research.
You'll need to make lots of flutes and use up a kilometre or two of pipe before you find exactly where to drill the holes, but it's not rocket science. Stone-age flutes several thousand years old have been found. Contrary to popular misconception, stone-age man was pretty clever. The only problem he had with flutes was a lack of plastic water pipe. So he had to use hollow bones, but they worked.