core: fix build of tests with autotools

(cherry picked from commit 5424c5f9de9f7134eb3e98adc7a3889dddf6c3aa)