Alatatalantecuimar

Dinosaurs once roamed Arda when the world was lit by the two lamps and Arda was one. Almaren and Utumno stood polar opposite to each other as the Dinosaurs and Nameless did to each other. It was the Dinosaurs that intrigued Morgoth and what he eventually used to create the dragon and fell beast races.

Though some Maia watched over these powerful creatures--the majority were wiped off of Arda when Melkor came out in war and destroyed the Two Lamps. The ensuing fires engulfed and destroyed the majority of all dinosaur species--now only few of these creatures remain. The dinosaurs that remain either avoided the flames totally or have become lesser in stature. Eventually Melkor would sacrifice Maia spirits in order to create his own perverse versions of these creatures, and they would become powerful units in his armies.

Tolkien's Canon
When asked about the nature of the "steed of the Witch-king", Tolkien replied that the fell beast was not intended to be pterodactylic, but hesitantly acknowledged that it resembles a pterosaur and may have been a survivor of older geological eras.