"Zum Glück konnten wir ihn machen."
the gender in german is grammatical. i am afraid that duolingo does not stress this enough, especially since most of the users are english native speakers. "es" does not refer necessarily to inanimates objects, and on the other hand "it" can't always be translated as "es". in this sentence we don't know what that pronoun is referring to, but it must be something (grammatically) masculine.
Just in case anyone is reading this, 'could' is the past subjunctive mood and is 'können' in German. So "Zum Glück könnten wir ihn machen" would be "Luckily we could make it". 'were able to' is the past indicative mood, and is 'konnen' in German, so this sentence is "Luckily we were able to make him". I think that is why flis333 didn't pass it, though olimo and philster043 are right.
Look at http://en.wiktionary.org/wiki/k%C3%B6nnen#German. Each verb has all of these moods, but the past subjunctive is usually only used with the modal verbs in German.