core: Fix crashing make on initial build

Fixes #841