Makefile creation to install a custom package

Hello everyone!
I am trying to make a custom package of a library I need on my OpenWrt system. I have successfully compiled the library with the OpenWrt toolchain but I have some issues in writing the Makefile to make it a package.
I have followed the guide https://openwrt.org/docs/guide-developer/helloworld/start.The example here is for a simple executable application helloworld and I couldn't manage to apply it to a whole library.
In the Makefile writing I am having some problem with the definition of the build/compile part.
To be specific I have used the following commands to compile the application on my PC obtaining the compiled and linked version suitable for OpenWrt:

cmake /home/marta/vanetza \
    -DCMAKE_TOOLCHAIN_FILE=/home/marta/vanetza/cmake/Toolchain-x86.cmake \
    -DCMAKE_FIND_ROOT_PATH=/home/marta/vanetza-deps \
    -DCMAKE_INSTALL_RPATH=\$ORIGIN/../lib \
    -DCMAKE_INSTALL_PREFIX=/home/marta/vanetza-dist
make

and I am not sure on how to translate it in the make file in order to specify everything as happened in the guide Makefile in the following lines:

$(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/helloworld.o -c $(PKG_BUILD_DIR)/helloworld.c
$(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/helloworld.o

Do you have any idea on how to solve this issue?
Do you think is possible to have another way to install the library on the system avoiding the passage through the package?
Thank you in advance for your time and help!