I had the same experience the first time I held a Gen 3 Glock 17. Hated it, couldn't shoot it, it was uncomfortable, etc etc.
Years later I tried a Gen 4 Glock 21 and somehow started to love it. Ended up with a few more Glocks.
NOW, the Gen 4 Glock 19 fits my hand perfectly, only surpassed by the 1911's and BHP.
I like M&P's fine for the ergos, but I sure hate the triggers (even with APEX). I can shoot em fine, but prefer Glocks or other options.
So, I guess, give it time and maybe Glock will grow on you.