Fix broken C file references across paths

Fixes #659
Initial report by Nikolai Weibull (@now)