This is not a happy marriage. Yahoo does not provide any access to their accounts at Yahoo.com to third party mail programs unless you sign up for their mail plus product.
For those unfortunate enough to live in the USA there is an add on Webmail which will get your mail into Thunderbird for you.
If you live outside of the USA the news is far better. You can enable POP access you your Yahoo account in the Yahoo options and download your inbox to Thunderbird. It is a limitation of the POP protocol that your can only download the inbox, to other folders that you have in Yahoo will not appear. Remember to turn off any filtering to folders that your have on Yahoo or you will not get the filtered mail into your inbox.