سَلَّمْتُ عَلَى يَشْكُرَ - here يَشْكُرَ is a proper name after a preposition; as ghayr munsarif it takes fathah in the genitive.
يَشْكُرُ الطَّالِبُ مُعَلِّمَهُ - here يَشْكُرُ is an actual imperfect verb: “the student thanks his teacher.”
The same unvowelled spelling can represent different grammatical functions; context and the final vowel distinguish them.