As other have mentioned, it really depends on what you mean by "decent program."
For top and very good programs, the GRE score is likely to act as a first-round sieve to cut down the number of applicants to be considered. I remember when I was applying, I was told by someone at what was one of the top 5 departments in the US that an application should have a subject test score of at least 880 to be considered (at the time it was scored out of 980; I don't know what they are doing now). However, my impression was that once past that "goal keeper", GRE scores were much less important, and the major emphasis was given to the letters of recommendation and the applicant's past success in mathematics courses (especially advanced ones). A weak math background did not preclude admission, provided it was somehow explained and there was good reason to believe that success in the program was likely, e.g., good letters of recommendation and an explanation of why the student had a weak math background (in fact, my graduate institution had a special program for people with weak mathematical backgrounds but who were otherwise qualified applicants, which gave them an extra year during which they would take upper division undergraduate mathematics courses before being "officially admitted" to the Ph.D. program).
Smaller programs may have their hands forced by their University's Graduate Division, though in almost all cases they are likely to be able to request exceptions.
Generally speaking, a weak math background needs to be explicitly and clearly explained in the application materials. This can be as simple as "I didn't realize how much I liked math until after graduation; since then I've done this, this, and this..." The letters of recommendation carry more weight, but only if they are from people who are in a position to speak knowledgeably about your ability to succeed in a mathematics graduate program: that is, (i) people who have gone through a graduate program in mathematics; and (ii) who are in a position to be familiar with your mathematical abilities as well as any personal qualities that will help you overcome any deficiencies in your background. I can't tell you how many times I've read applications by people with weak mathematical backgrounds who offer no explanation of why they are now applying to a math program, and whose letters of recommendation come from either professors in other Departments or their bosses at their current (completely non-mathematical/non-academic) jobs. Such applications always get rejected, often "with prejudice" (I am unhappy to be asked to waste my time reading through it, and will not give this applicant the benefit of the doubt if the applicant applies again, which some do).
While most departments are more than happy to accept someone who is likely to succeed, whatever their background prior, budgetary realities mean that they are unlikely to take a gamble on an unknown (also, they may be penalized later by their administration, since drop-outs count against the Department).
In short: a good GRE score is certainly a good idea, and probably necessary, but by itself it cannot and will not substitute for a thin background. Address the background directly and clearly, and try to secure at least one recommendation letter from someone who meets the two qualities I described above. Contact the Department's Graduate Coordinator (or whoever is in charge of graduate admissions; it may simply be a committee in the Department) and ask about admissions, explaining your situation, ahead of time, to know what you will need to address explicitly in that application.