If you have access to a source of random data, just extract the random data directly.
If you're generating the key from a cryptographically-secure source, there is no reason to use a slow KDF like PBKDF2. The only reason to use a slow KDF is if the input material does not have sufficient entropy for your use-cases. If the key itself already has 128 bits, then there's never a reason to pass it through PBKDF2 (or bcrypt, or scrypt, or Argon2, or S2K...).
If you are deriving your key from a low-entropy passphrase, then a slow KDF is vital to slow down brute force attacks. However in that case, you'd be better off using a memory-hard KDF like Argon2 and not PBKDF2, as memory-hardness makes it more difficult to parallelize attacks.
To answer your exact question, you shouldn't be using the openssl
command line utility at all. You should be extracting random data using whatever API your programming language provides, such as crypto.getRandomValues()
in JavaScript, getrandom()
in C, the /dev/urandom
device, etc.