All of the above options should be able to do what you required.
I would like to add OpenCV to the list. It's a fast cross-platform computer vision library with extensive image loading, saving and processing support. It's written in C, but it has a solid C++ interface, which I have used in the past.
That being said: Reading / writing PPMs is straight-forward, so if all you need is to read and threshold, you should definitely consider doing it yourself. It would come down to reading the PPM bytes into memory, greyscaling by averaging the RGB color channels (note that averaging the RGB channels is one, very simple, method to greyscale; there are more), then thresholding and writing away.