Doing this in any autoconf-based program:
$ ./configure CC="/usr/bin/clang-8" CFLAGS="-Weverything -O6 -flto=full" LDFLAGS="-fuse-ld=/usr/bin/ld.lld-8"
-O4 works, but generates this diagnostic:
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]