When reporting a build problem, always show the complete configure and make
command lines you used, and any environment variables you set that might be
relevant. If you are building from git rather than from the release tar
file (or you used --enable-maintainer-mode), then you also need to tell us
which versions of autoconf and automake you used.
If you have a previous version of elfutils already installed or built, then
use the eu-findtextrel tool on libdw.so. If you don't, then you can
comment out that readelf | fgrep line from libdw/Makefile to let the build
complete, and then run the src/findtextrel program just built, like this:
LD_LIBRARY_PATH=libelf:libdw:backends ./src/findtextrel libdw/libdw.so
If that produces a torrent of output, then it's likely that you somehow
managed to compile without -fpic, which shouldn't really be possible unless
you changed something. In that event, we'll likely need to see the entire
output from configure and make to help you.
If it produces just a little output, then there may be something wrong with
your compiler installation or something like that. But we won't really be
able even to guess until we see all those details.