On the optimal search for a target whose motion is a Markov process