Fixed running tests in seperate build directory (e.g. during distcheck).