一个c程序同时用到了两个动态库的函数,makefile怎么写?

# 只用一个动态库时
prog :main.c
    gcc -o $@ $^ -lzn -L./ -Wl,-rpath,./

test1.c 中的函数test1用到了libzn.so
test2.c 中的函数test2用到了libzp.so
main.c 用到了test1.c中的test1函数和test2.c中的test2函数

# 使用两个动态库时,怎么写Makefile ?
prog : test1.c test2.c main.c
  gcc -o $@ $^ -l???  -L./ -Wl,-rpath,./

gcc -o $@ $^ -lzn -lzp  -L./ -Wl,-rpath,./ 

-l 可以多次指定链接库