You need to put the library at the end of compilation when you are linking the program:
gcc Dirac.c -o Dirac -llapack -lm
The way the linking process works is that the library is used to find unresolved symbols that have come up so far. When you put -llapack
first, since there are not yet any unresolved symbols in your program (since it hadn't compiled anything yet), it doesn't end up using the library.