Nothing in AltF Lexicon rhymes with margarine. Its pronunciation ends in the phonemes MAARJHERAHN, and no other entry in the corpus shares that ending. A word with a rhyme key of its own and no company is genuinely unrhymable in ordinary English — orange is the famous case, and this is another.
Two words rhyme when their pronunciations agree on every phoneme from the last stressed vowel to the end of the word. Nothing about spelling is consulted — that is why eight rhymes with freight and straight, and why cough rhymes with none of though, through or bough. For margarine the matched ending is MAARJHERAHN. The key is the pronunciation from the last stressed vowel onward, written in the CMU Pronouncing Dictionary's phoneme alphabet. Every entry sharing it rhymes.
margarine has no rhyme. Its ending MAARJHERAHN is unique among the entries in AltF Lexicon — no other word in the corpus is pronounced that way from its last stressed vowel onward.
Pronunciations and rhyme keys come from the CMU Pronouncing Dictionary; definitions and commonness come from WordNet and a corpus of everyday English. Full sources and licences.