To some extent you are correct that the smaller user base of Linux and Mac OS makes them less attractive targets for attackers.
It's my belief that the Linux user base is a good deal more technically (and thus security) aware than the average PC user, so it is hard to see an increase in Linux use equating to greater opportunities for attackers.
I wouldn't say the same for Mac users, however - that's not having a go at Apple, just that the Apple ethos has always been about using their products, not having to understand them.
Also, I believe that Linux is inherently a more secure architecture than Windows.
Here's a useful article on the subject:
Overview of Linux Kernel Security Features | Linux.com
But it's all too easy to be complacent.
SD