The question of whether a sentence be grammatical equivales the existence of a parse tree which, when linearised, yields the original sentence.
Because the sentence is finite, it has a finite number of components, and hence a finite number of possible parse trees, so we could enumerate them all until we find one that works.
Exercise: what is the maximum number of parse trees a sentence of length N might have?
However (being an english speaker and using wetware as an oracle) a suitable witness can be found by inspection:
and
├─can buy
│ ├─Money
│ └─of
│ ├─if not
│ │ ├─if not
│ │ │ ├─many
│ │ │ └─most
│ │ └─all
│ └─that
│ ├─the things
│ └─make
│ ├─people
│ └─happy
└─if/then
├─doesn't [buy]
│ ├─it
│ └─[them]
└─is
├─the fault
└─ours
QEF