build: fix backend detection in configure script.