We study the problem of tracking moving objects using distributed Wireless Sensor Networks (WSNs) in which sensors are deployed randomly. Due to the uncertainty and unpredictability of real-world objects' motion, the tracking algorithm is needed to adapt to real-time changes of velocities and directions of a moving target. Moreover, the energy consumption of the tracking algorithm has to be considered because of the inherent limitations of wireless sensors. In this paper, we proposed an energy efficient tracking algorithm, called Predict-and-Mesh (PaM) that is well suited for pervasively monitoring various kinds of objects with random movement patterns. PaM is a distributed algorithm consisting of two prediction models: n-step prediction and collaborative prediction, and a predication failure recovery process called mesh. The simulation results show that the PaM algorithm is robust against diverse motion changes and has the excellent performance.