Languages with small phoneme inventories such as Pirahã often encourage different constructions of the phoneme system. In the case of Pirahã, it either lacks phonemic velars or phonemic nasals. Are there any metrics to measure which option is more likely?
Pirahã has a consonant phoneme that's pronounced [g] in some contexts and [n] in others. (It has no other nasal phonemes, and arguably no other velar phonemes.) So the question here is, "Is this Mystery Consonant really a /g/, or is it really an /n/?"
As a matter of convention, linguists tend to name consonants after their default pronunciation if there is a clear default. According to the Wikipedia article, the Pirahã Mystery Consonant is pronounced [n] after a pause and [g] elsewhere. That suggests that [g] is the default pronunciation, and that we should name the phoneme /g/. And by the looks of it, that's what the linguists who work on Pirahã have done.
For what it's worth, too, it's not terribly uncommon for languages to lack nasal phonemes. Whereas it's quite uncommon for languages to lack velar phonemes: /k/ is the most common consonant across languages. (There are some languages without phonemic /k/, including Tahitian and maybe some varieties of Hawaiian. But it's very, very rare.)