Not all fax machines can do this, so you'll have to consult the documentation for yours to find out if this is even possible. If it is, they will likely have instructions on how to do it.
Also, you might consider a laser based fax machine. Won't do anything to stop junk faxes, but the toner goes a lot further than inkjet carts. Even your basic starter toner cart has enough in it for about 2,000 pages. Replacement toner carts only cost about $10US more than inkjet carts, and should last for around 5,000 pages, making them far more economical over the long term. Only significant drawback is color laser printers are very expensive generally.
If you are in the US, doesn't the Do Not Call list also apply to junk faxes? I'd add the fax number regardless, since worst case is you waste a couple of minutes for no change in the number of junk faxes. If you're not in the US, if there's anything similar to the Do Not Call list, which prevents unsolicited telemarketing calls, put your fax number on the list. Also, NEVER include a phone number or fax number if you fill out warranty cards. In fact, just don't fill them out period. You give them an address, the company will most likely sell it to junk mailers. Give them a phone number, it gets sold to telemarketers. Fax numbers get sold to junk faxers, email addresses sold to spammers, etc. Every bit of information you put down gets resold. Even if the company claims they won't sell your info, they will. Plenty of people have reported cases where they get a new fax machine, and very shortly after sending in a warranty card or product registration card, the junk faxes start rolling in. It may not be the company selling your info so much as some employee looking to make a quick buck, but does it really matter to you which is doing it?