You can "re-roll" npc stocks, just like chests.
Quick save before talking to the vendor, if they don't have books you want, exit the vendor menu, and reload.
Some books are linked to level, and if you can't be bothered to reload, just visit them after you've leveled up or completed a quest. Has worked for me.