Ok, good.
First write a small sketch to read the input from the anemometer using digitalRead() and print the result to the serial monitor. You will need to set the digital pin mode to INPUT_PULLUP. As mentioned by the other Paul, you will need to connect 5V and ground to the Mega, and a digital pin of your choice. When you upload this code, you should see values alternating between "0" and "1" on the serial monitor as you turn the anemometer slowly by hand. This will prove that the anemometer is working, that the connections are correct and that the Mega can detect the square wave signal.